package com.jsontom.springbootnacosconfig;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author tom
 * @version V1.0
 * @date 2021/4/17 18:44
 */
@RestController
@NacosPropertySource(dataId = "example",autoRefreshed = true)
public class NacosConfigController {

    @NacosValue(value = "${info:Local Hello World}",autoRefreshed = true)
    private String info;

    @RequestMapping("/config")
    public String get(){
        return info;
    }

}
